import torch
import os
import pandas as pd

os.makedirs(os.path.join('..', 'dataset'), exist_ok=True)
data_file = os.path.join('..', 'dataset', 'house_tiny.csv')
with open(data_file, 'w') as f:
    f.write('Numrooms,Alley,Price\n')
    f.write('NA,Pave,127500\n')
    f.write('2,NA,106000\n')
    f.write('4,NA,178100\n')
    f.write('NA,NA,140000\n')
data = pd.read_csv(data_file)
print(data)
print(type(data))
inputs, outputs = data.iloc[:, 0:2], data.iloc[:, 2]
print(inputs)
inputs = inputs.fillna(inputs.mean())
print(inputs)
inputs = pd.get_dummies(inputs, dummy_na=True)
print(inputs)
X, Y = torch.tensor(inputs.values), torch.tensor(outputs.values)
print(X)
print(Y)
